package com.fantasy.robot;

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.InputEvent;

public class TestSW {

	public static void main(String[] args) {
		try {
			Robot robot = new Robot();
			robot.delay(3000);
			robot.keyPress(17);
			robot.keyPress(65);
			robot.delay(500);
			robot.keyRelease(17);
			robot.keyRelease(65);
			robot.mousePress(InputEvent.BUTTON3_MASK);
			robot.mouseRelease(InputEvent.BUTTON3_MASK);
			
			try {
				Thread.sleep(60000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			for (int i = 0; i < 60; i++) {
				robot.keyPress(17);
				robot.keyPress(65);
				robot.delay(500);
				robot.keyRelease(17);
				robot.keyRelease(65);
				robot.mousePress(InputEvent.BUTTON3_MASK);
				robot.mouseRelease(InputEvent.BUTTON3_MASK);
				
				try {
					Thread.sleep(120000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			
			
		} catch (AWTException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} // 创建一个robot对象
	}
}
